home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / progra / mai / Files, launching based on file extension < prev    next >
Encoding:
Text File  |  1997-07-14  |  772 b   |  16 lines

  1. 'Description: Lauches an application based on file extension
  2.  
  3. 'Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  4. 'Private Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
  5.  
  6. 'Function StartDoc (DocName As String) as long
  7. Dim Scr_hDC as long
  8. Scr_hDC = GetDesktopWindow ()
  9. 'change "Open" to "Explore" to bring up file explorer
  10. StartDoc = ShellExecute (Scr_hDC, "Open", DocName, "", "C:\", 1) 
  11. 'end function
  12.  
  13. 'Place the following code in under a command button or in a menu, etc...
  14.  
  15. dim r as long
  16. r = startdoc ("C:\windows\arcade.bmp")